<template>
    <div>
        <div class="dabg">
            <div class="gebgh">
                <div>
                    <h2><span class="hbnh" @click="$router.go(-1)"><a class="fan"></a></span> 每日停复牌 <a
                            class="shaux" @click="tingfuList = [];stockgetStop()"></a>
                    </h2>
                </div>
                <div class="sou">
                    <div>
                        <div class="sousuo" @click="getsearch">
                            <span></span>
                            <input placeholder="名称/代码/拼音首字母" disabled="disabled">
                        </div>
                    </div>
                </div>
            </div>
            <div class="topTen">
                <div class="let" v-for="(item, index) in paihangList" :key="index" @click="gettab(index)"
                    :class="paihangIdx == index ? 'xuan' : ''">{{ item.name }}</div>
                <span class="pokl" :style="paihangIdx == 0 ? 'left: 25%;' : 'left: 75%;'"></span>
            </div>
            <div class="ulkm"><span class="spl1">股票代码</span><span class="spl2">停牌日期</span><span
                    class="spl3">停牌截止时间</span>
            </div>
            <ul class="uls">
                <li v-for="(item,index) in tingfuList" :key="index">
                    <div class="lile">
                        <h6>{{item.SECURITY_NAME_ABBR}}</h6>
                        <p>{{item.SECURITY_CODE}}</p>
                    </div>
                    <p class="lice">{{item.SUSPEND_START_DATE}}</p>
                    <p class="lice">{{item.SUSPEND_END_TIME ? item.SUSPEND_END_TIME : '--'}}</p>
                </li>
            </ul>
        </div>
    </div>
</template>
<script>
import { Toast } from 'vant';
import { MessageBox } from 'mint-ui'
import * as api from '@/axios/api'
export default {
    props: {},
    data() {
        return {
            paihangList: [
                {
                    name: '停牌查看',
                },
                {
                    name: '复牌查看',
                }
            ],
            paihangIdx: 0,
            tingfuList: [],
        }
    },
    mounted() {
        this.stockgetStop()
    },
    methods: {
        getsearch() {
            this.$router.push({
                path: '/Searchlist'
            })
        },
        gettab(index) {
            this.paihangIdx = index
            if (index == 0) {
                this.stockgetStop()
            } else {
                this.tingfuList = []
            }
        },
        async stockgetStop() {
            let data = await api.stockgetStop()
            if (data.status === 0) {
                this.tingfuList = data.data
            } else {
                Toast(data.msg)
            }
            this.$store.state.user = this.user
        },
    }
}
</script>
<style lang="less" scoped>
.dabg {
    background: #fff;

    .gebgh {
        height: 3.34rem;
         background: linear-gradient(-55deg, rgb(241, 22, 20), rgb(241, 22, 20));

        h2 {
            text-align: center;
            height: 1.25rem;
            width: 100%;
            position: relative;
            line-height: 1.25rem;
            font-size: .48rem;
            color: #fff;
            background: transparent;
            font-weight: 500;
            z-index: 3;

            .hbnh {
                position: absolute;
                left: 0.4rem;
                font-size: .43rem;
                font-weight: 500;

                .fan {
                    width: 0.24rem;
                    height: 0.43rem;
                    background: url() no-repeat 50%;
                    background-size: 100%;
                    display: inline-block;
                    margin-right: 0.13rem;
                    vertical-align: middle;
                    margin-top: -0.05rem;
                }
            }

            .shaux {
                position: absolute;
                width: 0.48rem;
                height: 0.48rem;
                background: url() no-repeat 50%;
                background-size: 100%;
                right: 0.4rem;
                top: 0.4rem;
            }
        }

        .sousuo {
            width: 9.35rem;
            height: 0.91rem;
            background: hsla(0, 0%, 100%, .2);
            border-radius: 0.45rem;
            margin: 0 auto;
            display: flex;

            span {
                width: 0.43rem;
                height: 0.43rem;
                background: url() no-repeat 50%;
                background-size: 100%;
                margin-left: 0.266rem;
                margin-top: 0.21rem;
            }

            input {
                height: 0.91rem;
                margin-left: 0.19rem;
                width: 7.48rem;
                background: transparent;

                &::placeholder {
                    color: rgb(213, 204, 255);
                    font-size: 0.38rem;
                }
            }
        }
    }

    .topTen {
        display: flex;
        justify-content: space-between;
        border-radius: 0.4rem 0.4rem 0 0;
        margin: 0 auto;
        margin-top: -0.8rem;
        background: #fff;
        padding-top: 0.19rem;
        padding-bottom: 0.37rem;
        position: relative;

        .let {
            width: 50%;
            height: 0.8rem;
            text-align: center;
            line-height: 0.8rem;
            color: #666;
            font-size: .38rem;

            &:first-child {
                border-right: 2px solid #e0e0e0;
            }
        }

        .xuan {
            color: #5d7dfb;
        }



        .pokl {
            position: absolute;
            width: 0.53rem;
            height: 0.11rem;
            background: #5d7dfb;
            border-radius: 0.053rem;
            bottom: 0.32rem;
            margin-left: -0.266rem;
            transition: all .5s;
        }
    }

    .ulkm {
        width: 100%;
        height: 0.88rem;
        border-top: 0.0266rem solid #e0e0e0;
        border-bottom: 0.0266rem solid #e0e0e0;
        display: flex;
        justify-content: space-between;
        span {
            color: #999;
            font-size: .32rem;
            line-height: .88rem;
            width: 22%;
        }
        .spl1 {
            margin-left: 0.32rem;
            width: 25%;
        }

        .spl2 {
            width: 35%;
            text-align: center;
        }

        .spl3 {
            width: 30%;
            text-align: center;
            margin-right: 0.32rem;
        }
    }

    .uls {
        width: 100%;
        list-style: none;

        li {
            height: 1.42rem;
            border-bottom: 0.03rem solid #e0e0e0;
            display: flex;
            justify-content: space-between;

            .lile {
                margin-left: 0.32rem;
                width: 25%;

                h6 {
                    color: #1a1a1a;
                    font-size: .37rem;
                    font-weight: 500;
                    padding-top: 0.266rem;
                    font-weight: 600;
                }

                p {
                    color: #666;
                    padding-top: 0.266rem;
                    font-size: .32rem;
                }
            }

            .lice {
                text-align: center;
                color: #1a1a1a;
                font-size: .32rem;
                line-height: 1.42rem;
                width: 35%;
            }

            span {
                text-align: center;
                color: #1a1a1a;
                font-size: .32rem;
                line-height: 1.42rem;
                width: 30%;
                margin-right: 0.32rem;
            }
        }
    }
}
</style>